﻿using Billing.Service.Wcf.Dto;
using Helpers.Common;
using System.Collections.Generic;
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Web;

namespace Billing.Service.Wcf {
    [ServiceContract]
    public interface IWcfService
    {
        [OperationContract]
        [WebInvoke(
            Method = "PUT",
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "catalogs/addItem")]
        Response<int> AddCatalogItem(Dto.CatalogItem catItem);
        [OperationContract]
        [WebInvoke(
            Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "products/adjustPrice")]
        Response<bool> AdjustProductsPrice(double adjIndex);
        [OperationContract]
        [WebInvoke(
            Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "catalogs/"
                        + "{catName}")]
        Response<List<Dictionary<string, object>>> GetCatalog(string catName);
        [OperationContract]
        [WebInvoke(
            Method = "POST",
            //ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "runProcedure")]
        Stream RunProcedure(ProcedureCall procCall);
        [OperationContract]
        [WebInvoke(
            Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "catalogs/updateItem")]
        Response<bool> UpdateCatalogItem(Dto.CatalogItem catItem);
    }
}